home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / patchgcc.233 < prev    next >
Text File  |  1993-07-26  |  3KB  |  82 lines

  1. This file contains two small patches that correct problems with gcc-2.3.3
  2. that interfere with compilation of Ptolemy (gcc-2.2.2 will compile Ptolemy
  3. without changes).
  4.  
  5. To apply the patches, cd to the gcc-2.3.3 sources directory and say
  6.  
  7. patch < THIS_FILE
  8.  
  9. where THIS_FILE is replaced with the name of this file.  If you've
  10. already installed gcc, it suffices to simply rebuild cc1plus using
  11. your pre-installed gcc, saying something like
  12.  
  13. make CC=gcc CFLAGS="-g -O" cc1plus
  14.  
  15. You can then move cc1plus into the directory containing the compiler
  16. passes.
  17.  
  18. The first patch corrects a problem with automatic type conversions that was
  19. introduced in 2.3.x.  Here it is:
  20.  
  21. *** cp-typeck.c.orig    Mon Nov 23 17:48:44 1992
  22. --- cp-typeck.c    Mon Jan  4 14:25:09 1993
  23. ***************
  24. *** 1597,1602 ****
  25. --- 1597,1610 ----
  26.       return error_mark_node;
  27.   
  28.     itype = TREE_TYPE (index);
  29. +   /* We must check here for the reference, so we can do the possible
  30. +      conversions immediately afterwards.  */
  31. +   if (TREE_CODE (itype) == REFERENCE_TYPE)
  32. +     {
  33. +       index = convert_from_reference (index);
  34. +       itype = TREE_TYPE (index);
  35. +     }
  36.     if (IS_AGGR_TYPE (itype))
  37.       {
  38.         if (TYPE_HAS_INT_CONVERSION (itype))
  39. ***************
  40. *** 1608,1619 ****
  41.                   "type `%s' requires integer conversion for array indexing");
  42.         return error_mark_node;
  43.       }
  44. -     }
  45. -   if (TREE_CODE (itype) == REFERENCE_TYPE)
  46. -     {
  47. -       index = convert_from_reference (index);
  48. -       itype = TREE_TYPE (index);
  49.       }
  50.   
  51.     if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
  52. --- 1616,1621 ----
  53.  
  54. This patch gets rid of warnings for global constants.
  55.  
  56. *** cp-decl.c.orig    Fri Dec  4 16:16:51 1992
  57. --- cp-decl.c    Tue Jan 12 18:00:06 1993
  58. ***************
  59. *** 7302,7308 ****
  60.     else if (specbits & 1 << (int) RID_EXTERN && initialized && !funcdef_flag)
  61.       {
  62.         if (current_binding_level == global_binding_level)
  63. !     warning ("`%s' initialized and declared `extern'", name);
  64.         else
  65.       error ("`%s' has both `extern' and initializer", name);
  66.       }
  67. --- 7302,7313 ----
  68.     else if (specbits & 1 << (int) RID_EXTERN && initialized && !funcdef_flag)
  69.       {
  70.         if (current_binding_level == global_binding_level)
  71. !     {
  72. !       /* warn only if a non-const global extern object has an initializer.
  73. !          "extern const" with initializer is completely legit in C++. */
  74. !       if ((specbits & 1 << (int) RID_CONST) == 0)
  75. !         warning ("`%s' initialized and declared `extern'", name);
  76. !     }
  77.         else
  78.       error ("`%s' has both `extern' and initializer", name);
  79.       }
  80.